import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    msg: 'welcome to vuex',
    address: '南京'
  },
  getters: {
    msg2(state){
      return state.msg.toUpperCase().split(' ').reverse().join(' ')
    }
  },
  mutations: {
    setMsg(state, newValue){
      state.msg = newValue
    }
  },
  actions: {
  },
  modules: {
  }
})
